<?php
	class AdminHelper
	{
		static public function getAdminDaohang()
		{
			$ids	= $_SESSION['ids'];
			
			if($ids==0){
				$where	= '';
			}else{
				$where = "id in($ids)";
			}
			
			#获取后台导航
			$list	= ORM_Finder::find('Daohang', $where, '*', NULL, '0,60');
			$return = array();
			if(!empty($list))
			{
				foreach ($list as $var)
				{
					$return[$var->getPid()][$var->getId()]	= array('id'=>$var->getId(),
								'pid'=>$var->getPid(),'name'=>$var->getName(),
								'url'=>$var->getUrl(),'display'=>$var->getDisplay(),
								'location'=>$var->getLocation(),'cls'=>$var->getCls());
				}
			}
			return $return;
		}
		
		static function passwordEncode($password)
		{
			return md5(substr(md5(md5(base64_encode($password))),0,16));
		}
	}
?>